//
//  DishThumbWrapperView.h
//  XRmenu
//
//  Created by loufq on 11-3-21.
//  Copyright 2011 E0571. All rights reserved.
//

#import "XRmenuBaseView.h"
#import "DishThumbView.h"
#import "DishAlbumNavView.h"
#import "DishOperView.h"

typedef enum
{
	DisplayModelWithShow=0,//仅仅是展示用 没有任何其他操作
	DisplayModelWithSimple=1,//有查看操作 没有详细操作
	DisplayModelWithAll=2//详细操作 
} DishDisplayModel;//展示模式

@protocol DishThumbWrapperViewDataSource;
@protocol DishThumbWrapperViewDelegate;

@interface DishThumbWrapperView : XRmenuBaseView <
DishAlbumNavViewDelegate
,DishThumbViewDelegate
,DishOperViewDelegate>{
	NSInteger rows;//显示行数
	NSInteger columns;//显示列数
	NSInteger currentPageIndex;//当前页
	NSInteger pageCount;//总页数
	id<DishThumbWrapperViewDataSource> datasource;
	id<DishThumbWrapperViewDelegate> delegate;
	DishAlbumNavView* mNavView; 
	DishDisplayModel displayModel;
	
	//缩略图的大小
	//缩略图的边距
	CGSize thumbWrapperSize;
	CGSize thumbImageSize;
	CGSize thumbMargin;
	
	NSString* specDishId;//指定的DishId
	
	//当前操作的对象
	DishThumbView* currentDishThumbView;
	NSInteger perOrderCount;
	//可以服用的数组
}

@property (nonatomic, copy) NSString *specDishId;
@property (nonatomic, assign) DishDisplayModel displayModel;
@property (nonatomic, assign) id<DishThumbWrapperViewDataSource> datasource;
@property (nonatomic, assign) id<DishThumbWrapperViewDelegate> delegate;
@property (nonatomic, retain) DishAlbumNavView *mNavView;
@property (nonatomic, retain) DishThumbView* currentDishThumbView;

-(id)initWithTarget:(id)aTarget position:(CGPoint)aPosition style:(NSInteger)aDishDisplayModel;

-(void)reloadData;

-(void)showPageAtDishId:(NSString*)aDishId;

//外部调用用
- (void)handleSwipeLeft:(UISwipeGestureRecognizer *)recognizer;
- (void)handleSwipeRight:(UISwipeGestureRecognizer *)recognizer;

//外部改变刷新
-(void)freshInfoWithProduct:(Product*)aProduct;
//清空内容
-(void)cleanOrderd;




@end

@protocol DishThumbWrapperViewDataSource
//框大小
-(NSInteger) dishThumbWrapperViewRowsInPage;//行数
-(NSInteger) dishThumbWrapperViewColumsInPage;//列数
-(NSInteger) dishThumbWrapperDisplayCount;//总记录数

//aposition是总共的第几个 aIndex是当前页的第几个
-(DishThumbView*)dishThumbWrapperView:(DishThumbWrapperView *)aDishWrapper viewAtPosition:(NSInteger)aPosition inPageIndex:(NSInteger)aIndex;
@optional
-(CGSize) dishThumbWrapperSize;
-(CGSize) dishThumbImageSize;//
-(CGSize) dishThumbMargin;//
 
@end

@protocol DishThumbWrapperViewDelegate
//celltouch
//

@end



